package com.sljy.hzk.net.service;

import com.sljy.hzk.entity.DetectionDangerEntity;
import com.sljy.hzk.entity.DetectionHistroyEntity;
import com.sljy.hzk.entity.DetectionPartitionEntity;
import com.sljy.hzk.entity.ExamSubmitEntity;
import com.sljy.hzk.net.CommonResult;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created  on 2018/7/10 0010
 *
 * @author 唐开阔
 * @describe
 */
public interface DetectionService {
    @FormUrlEncoded
    @POST("harm/partiton.do")
    Observable<CommonResult<DetectionPartitionEntity>> getAllDetectionPartition(@Field("comPId") long comPId);

    /**
     * 获取危害因素
     * @param pId
     * @return
     */
    @FormUrlEncoded
    @POST("harm/harmFactor.do")
    Observable<CommonResult<List<DetectionDangerEntity>>> getHarmFactor(@Field("pId") int  pId);

    /**
     * 提交一个危害
     * @param pId
     * @return
     */
    @FormUrlEncoded
    @POST("harm/collect.do")
    Observable<CommonResult<Object>> submit(@Field("userId") long userId,@Field("recordName") String recordName,@Field("pId") int  pId,@Field("comPId")long comPId,@Field("data") String data);


    /**
     * 提交一个危害
     * @param pId
     * @return
     */
    @FormUrlEncoded
    @POST("harm/collect.do")
    Call<CommonResult<Object>> submitSynchro(@Field("userId") long userId, @Field("recordName") String recordName, @Field("pId") int  pId, @Field("comPId")long comPId, @Field("data") String data);


    @FormUrlEncoded
    @POST("harm/getDayHarms.do")
    Observable<CommonResult<List<DetectionHistroyEntity>>> getHistroyInfo(@Field("comPId") int comPId, @Field("pId") int pId, @Field("userId") long userId);

}
